import logging,HTMLTestRunner_cn,yamail

class Tools():
    def log(self):
        log = logging.basicConfig(
            level=logging.DEBUG,
            filemode='a+',
            filename='jiuxian.log',
            format='%(levelname)s-%(filename)s-%(asctime)s-%(message)s-%(lineno)d'
        )
        return log

    def report(self):
        report = HTMLTestRunner_cn.HTMLTestRunner(
            open('jiuxian.html','wb'),
            title='酒仙网系统Web Ui自动化测试报告+当前的日志',
            description='酒仙网'
        )
        return report

    def mail(self):
        mail = yamail.SMTP(user='3080172040@qq.com',password='abhdfnpkqkmadgff',host='smtp.qq.com')
        mail.send(to='3080172040@qq.com',subject='酒仙网系统Web Ui自动化测试报告+当前的日志',contents=['酒仙网',
                                             'jiuxian.log',
                                             'jiuxian.html'])